/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Verito Ramirez
 *         Victor Jaramillo
 */
@Entity
@Table(name = "cxp_datofactura")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CxpDatoFactura.findAll", query = "SELECT s FROM CxpDatoFactura s"),
    @NamedQuery(name = "CxpDatoFactura.findBycxpCodigoDatFac", query = "SELECT s FROM CxpDatoFactura s WHERE s.cxpCodigoDatFac = :cxpCodigoDatFac"),
    @NamedQuery(name = "CxpDatoFactura.findBycxpNombreDatFac", query = "SELECT s FROM CxpDatoFactura s WHERE s.cxpNombreDatFac = :cxpNombreDatFac")})
public class CxpDatoFactura implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CXP_CODIGO_DATFAC")
    private String cxpCodigoDatFac;
    @Size(max = 30)
    @Column(name = "CXP_NOMBRE_DATFAC")
    private String cxpNombreDatFac;
    
    
    public CxpDatoFactura() {
    }
    
    public CxpDatoFactura(String cxpCodigoDatFac) {
        this.cxpCodigoDatFac = cxpCodigoDatFac;
    }

    public CxpDatoFactura(String cxpCodigoDatFac, String cxpNombreDatFac) {
        this.cxpCodigoDatFac = cxpCodigoDatFac;
        this.cxpNombreDatFac = cxpNombreDatFac;
    }

    public String getCxpCodigoDatFac() {
        return cxpCodigoDatFac;
    }

    public void setCxpCodigoDatFac(String cxpCodigoDatFac) {
        this.cxpCodigoDatFac = cxpCodigoDatFac;
    }

    public String getCxpNombreDatFac() {
        return cxpNombreDatFac;
    }

    public void setCxpNombreDatFac(String cxpNombreDatFac) {
        this.cxpNombreDatFac = cxpNombreDatFac;
    }

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cxpCodigoDatFac != null ? cxpCodigoDatFac.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CxpDatoFactura)) {
            return false;
        }
        CxpDatoFactura other = (CxpDatoFactura) object;
        if ((this.cxpCodigoDatFac == null && other.cxpCodigoDatFac != null) || (this.cxpCodigoDatFac != null && !this.cxpCodigoDatFac.equals(other.cxpCodigoDatFac))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "clases.CxpDatoFactura[ cxpCodigoDatFac=" + cxpCodigoDatFac + " ]";
    }
    
}
